//@ts-nocheck
/**@ts-nocheck  */



// 公共方法
(() => {
	let wd: any = window;

	class Scroll {
		/**
		 *
		 * @param dom 父容器(ul)的id
		 * @param _h 子元素li的高度
		 * @param interval 3000  滚动间隔时间
		 */
		constructor(dom: string, _h: string, interval: number) {

			const NodeList: any = document.querySelectorAll(`#${dom}`);

			[...NodeList].forEach(el=>{

				const timer = setTimeout(() => {
					let _field = el.firstElementChild;
					_field.style.marginTop = _h;
					clearTimeout(timer);
				}, 1000);
				setInterval(() => {
					let fields = el.firstElementChild;
					fields.style.marginTop = '0px';
					el.appendChild(fields);
					let _fieldchelid = el.firstElementChild;
					_fieldchelid.style.marginTop = _h;
				}, interval);
			})
			
			// const NodeList: any = document.getElementById(dom);
			// const timer = setTimeout(() => {
			// 	let _field = NodeList.firstElementChild;
			// 	_field.style.marginTop = _h;
			// 	clearTimeout(timer);
			// }, 1000);
			// setInterval(() => {
			// 	let fields = NodeList.firstElementChild;
			// 	fields.style.marginTop = '0px';
			// 	NodeList.appendChild(fields);
			// 	let _fieldchelid = NodeList.firstElementChild;
			// 	_fieldchelid.style.marginTop = _h;
			// }, interval);
		}
	}

	// 滚动方法
	function ScRoll(id: string, distance: string, time: number): any {
		let Roll = null;

		return Roll || (Roll = new Scroll(id, distance, time));
	}

	wd['ScRoll'] = ScRoll;

	interface sendData {
		adp_id: number,
		click_count: string,
		show_count?: string
	}

	//正规网站公用函数
	class publicJavaScriptfunction {

		/**
		 * 判断当前的是否是数组，否是就停止后面程序
		 * @param ArrAy 数组
		 */
		isArray(arratobj: Array<any>) {
			if (!Array.isArray(arratobj)) {
				return false;
			}
		}

		/**
		 * 延时执行函数
		 * @param fun 需要延时的函数 string
		 * @param time 需要延时的时间 number
		 */
		delayed(fun: any, time: number) {
			setTimeout(() => {
				eval(fun);
			}, time);
		}

		/**
		 * 公共样式
		 * @param e 样式key值
		 * @param img 所需要的图片
		 */
		common(e: any, img?: string | undefined): string {
			const communalFacilities: any = {
				w_h100: `width: 100%;height: 100%;`,
				backgImage: `background-image:url(${img})`,
				color: `color: #007aff`
			};

			return communalFacilities[e];
		}

		/**
		 *
		 * @param e 公共html模板key值
		 */
		templateMobile(e: string): string {
			const template: any = {
				signboard: `<div class="AdvertisingLogo" style='z-index: 2147483647!important;' >广告</div>`,
				wait: ` <div class="Mixlocs">广告<span>3</span></div>`,
				shut_off: `	<p><span id="close"></span></p>`
			};
			return template[e];
		}


		// 数据过滤以及 
		ServerDataSend(...data: any) {
			if (!data) return false;
			let objs, strlis = [];

			const reg=/\p{Unified_Ideograph}/u;  //正则表达式 汉字

			for (let index = 0; index < data.length; index++) {
				const element = data[index];
	
				typeof element === 'object' && (objs = element);
				typeof element === 'string' && (strlis.push(element)); // 把字符串转为数组
				
			}

			// 用于单个广告 的链接添加 点击统计

			strlis.length !==0 && (strlis.forEach(e => {(e.startsWith('https://') || e.startsWith('http://')) && this.AhrefOnclickFalse(e);}));

			// 用于多个广告 数组 或者是 object
			
			if (objs instanceof Object || objs instanceof Array) {


				[...objs].forEach((e: any, el: any, lis) => {


					if(e instanceof Object){
					
						for(const k in e){

							if(e[k] instanceof Object){
							
								[...e[k]].forEach(ex=>{
								
									for (const mk in ex) {

										this.AhrefOnclickFalse(ex[mk]);
									}
								});

							}else if( typeof e[k] === 'string'){

								(e[k].startsWith('https://') || e[k].startsWith('http://')) && this.AhrefOnclickFalse(e[k]);
							}

							
						}
					}
				})
			}


		}

		/**
		 * 用户点击广告时先组织 a 标签的默认行为 进行数据的服务端传递 进行广告目标地址的跳转
		 * @param href 跳转链接
		 */
		AhrefOnclickFalse(href: string) {

			setTimeout(() => {
				document.querySelectorAll(`a[href='${href}']`).forEach((els: any) => {

					console.log(`广告已可跳转,${els.href}`);
					els.setAttribute('onclick', 'return false');
				
					els.onclick = function () { 
						this.request( { adp_id: window.atob(sessionStorage.getItem(`YWRjaWQ=`)),show_count:1,click_count:1 });

						// window.location.href =href;

						// open(href)

						return false;
					}.bind(this);

					this.throttle()

				})
			}, 0)
		}


		/**
		 * 二次封装 ajax
		 * @param url url地址
		 * @param data 参数Object
		 * http://192.168.200.247:10063/api/index/index
		 */

		request( data: sendData, url: string = 'http://xionger.anquan123.com/api/index/index'): void {

			Ajax({ url: `${url}?${func('jointJSONString', data)}`, header: 'multipart/form-data' }).then((data: any) => {

				const { code = 1 } = data;

				const uin = sessionStorage.getItem('DataStrmd');

				if(uin === null) {	sessionStorage.setItem('DataStrmd',true);}
			

				parseInt(code) !== 1 && (uin === true &&   window.location.reload(),sessionStorage.setItem('DataStrmd',false));

			})

		}


		/**
		 * 函数节流
		 * @param func 回调函数
		 * @param delay 需要节流时间 默认2000
		 */
		 throttle(func:Function, delay:number = 2000):any {            
			let timer = null;            
			return function() {                
				let context = this,args = arguments;                
				if (!timer) {                    
					timer = setTimeout(function() {                        
						func.apply(context, args);                        
						timer = null;                    
					}, delay);                
				}            
			}        
		}

	}




	// 公共函数以及模板
	function IFunctionStore(e: string, ...data: any) {
		let Functions = null;

		return Functions || (Functions = new publicJavaScriptfunction()[e](...data));
	}


	wd['CustomEvent'] = IFunctionStore;
	// CustomEvent('request', 'http://192.168.200.247:10063/api/index/index', { show_count: 1, adp_id: 99 });
	CustomEvent('request',  { adp_id: 1,show_count:1,click_count:1 });


})();

(() => {

	// 移动PC 通用模板
	class Generals {
		/**
		 *底部新闻 右边 描述 左新闻 可向上循环移动
		 * @param lettitle string length in min 3
		 * @param newLst Array object {src:'',txt}
		 * @param time 间隔时间 默认为3000
		 */
		newspapers(lettitle: string, newLst: Array<object>, time = 3000, srt: number = 3): string {
			CustomEvent('isArray', newLst);

			CustomEvent('delayed', `ScRoll('scroll', '-4rem', ${time})`, 500);
			
			// 只能传入 数组对象
			let tp = '';
			if (newLst instanceof Array) {
				[...newLst].forEach((element: any) => {
					tp += `<li><a href="${element.src}" style='margin-left: 2rem;color: white;'> <strong>${element.txt}</strong></a></li>`;
				});
			}

			return `<div class="publictemplatestyle MonotonicShut-off overleaf">
			<div class="description">
				<strong>${lettitle.length >= srt ? lettitle.substring(0, srt) : lettitle}</strong>
			</div>
			<div>
				 <ul style="width:98%;height:4rem;overflow:hidden;line-height:4rem; white-space: nowrap;text-overflow: ellipsis;" id="scroll"> 
                        ${tp}
				</ul> 
			</div>
			<div>
                ${CustomEvent('templateMobile', 'shut_off')}
			</div>
             ${CustomEvent('templateMobile', 'signboard')}
		</div>`;
		}

		/**
		 * 图片文字描述向上滚动
		 * @param obj  ArrAy object {src：‘点击后的链接’，txt：‘显示的文字’,img:'显示的图片'}
		 */
		horizontalRotations(obj: Array<object>, time: number): string {

			console.log(obj);

			CustomEvent('isArray', obj);

			CustomEvent('delayed', `ScRoll('Imgse_Fuck', '-10rem', ${time})`, 200);

			let tp = '';
			[...obj].forEach((e: any) => {
				tp += ` <li>
                <div class="contter">
                    <a href="${e.src}">
                        <strong>${e.txt}</strong>
                        <img src="${e.img}" alt="">

                    </a>
                </div>
            </li>`;
			});

			return `
        <div class="bouttBox">
            <ul class="_container" id="Imgse_Fuck">
            ${tp}
        </ul>
		</div> `;
		}
	}

	function GeneralPublick(e: any, ...data: any) {

		let single = null;
		CustomEvent('ServerDataSend', ...data);
		return single || (single = new Generals()[e](...data));
	}

	window['General'] = GeneralPublick;
})();

// 移动模板
(() => {
	const Frames = `*{padding:0;margin:0}html body{width:100%;height:100%}a{text-decoration:none}a:link{color:blue;text-decoration:none}a:hover{color:red;text-decoration:underline}a:active:{color:red}a:visited{color:black;text-decoration:none}.publictemplatestyle{width:98%;height:6.4rem;margin:0.6rem;margin:1%;background-color:rgba(0,0,0,0.2)}h1 h2 h3 h4 h5 h6{margin-left:10px;line-height:0px}img{animation:fade-in;animation-duration:0.2s;-webkit-animation:fade-in 0.5s}strong{color:white}div>strong{color:white}.overleaf{position:fixed;bottom:5rem;z-index:2147483647!important}.publictemplatestyle>table{width:100%;height:auto;background:rgba(0,0,0,0.5);color:white}.publictemplatestyle>table>tbody>tr{text-align:center;line-height:3rem}.publictemplatestyle>table>tbody>tr:nth-last-child(){}.publictemplatestyle>table>tbody>td{text-align:center}.publictemplatestyle>table>tbody>td:nth-last-child(){}.zuoyoutuwen{background:rgba(0,0,0,0.18);display:flex;display:-webkit-flex;display:inline-flex}.zuoyoutuwen>.let{width:50%;height:100%;display:flex-direction}.zuoyoutuwen>.let>img{width:100%;height:100%}.shoumeges{display:flex;display:-webkit-flex;height:100%}.imgAdvertisementForm>.shoumeges>div{text-align:center;flex-grow:3;height:100%}.shoumeges>div>img{width:100%;height:100%;height:auto;max-width:100%;max-height:100%;animation:animated-border 1s infinite;font-family:Arial;font-size:18px;line-height:30rpx;font-weight:bold;color:#8f8f94;border-radius:10px;animation:fade-in;animation-duration:2s;-webkit-animation:fade-in 1.5s}.titleImges>img{width:100%;height:100%}.MonotonicShut-off{display:flex;display:-webkit-flex;background:rgba(0,0,0,0.18);height:4rem;overflow:hidden}.MonotonicShut-off>div{flex-grow:3;justify-content:space-around}.MonotonicShut-off>div:nth-child(2){width:70%}.MonotonicShut-off>div:nth-child(2)>a>strong{line-height:4rem}.MonotonicShut-off>div:nth-child(3){width:5%}.MonotonicShut-off>div:nth-child(3)>p{line-height:4rem;text-align:center}.description{width:3rem;height:100px;background-color:#aa0000;position:relative}.description:after,.description:before{border:solid transparent;content:" ";height:0;left:100%;position:absolute;width:0}.description:after{border-left-color:#aa0000;top:-2.5rem}.description:before{border-width:2rem;border-left-color:#aa0000}.description>strong{line-height:4rem;margin-left:1rem;color:white}#close{display:inline-block;width:1.2rem;height:4px;background:#333;transform:rotate(45deg)}#close::after{content:"";display:block;width:1.2rem;height:4px;background:#333;transform:rotate(-90deg)}@keyframes fade-in{0%{opacity:0}40%{opacity:0}100%{opacity:1}}@-webkit-keyframes fade-in{0%{opacity:0}40%{opacity:0}100%{opacity:1}}@keyframes animated-border{0%{box-shadow:0 0 0 0 rgba(255,255,255,0.4)}90%{box-shadow:0 0 0 10px rgba(255,255,255,0)}}.slide{margin:auto;width:600px;height:200px;text-align:center;font-family:Arial;color:#fff;overflow:hidden}.slide ul{margin:10px 0;padding:0;width:9999px;transition:all 0.5s}.slide.slide-auto{animation:marginLeft 10.5s infinite}.slide li{float:left;width:600px;height:200px;list-style:none;line-height:200px;font-size:36px}.slide li:nth-child(1){background:#9fa8ef}.slide li:nth-child(2){background:#ef9fb1}.slide li:nth-child(3){background:#9fefc3}@keyframes marginLeft{0%{margin-left:0}28.5%{margin-left:0}33.3%{margin-left:-600px}62%{margin-left:-600px}66.7%{margin-left:-1200px}95.2%{margin-left:-1200px}100%{margin-left:0}}.banner{width:100%;height:9.4rem;overflow:hidden;margin:0 auto}.inner{width:9999px;position:relative;animation:aaa 16s infinite 2s running}@keyframes aaa{0%{transform:translateX(0px)}5%{transform:translateX(-640px)}25%{transform:translateX(-640px)}30%{transform:translateX(-1280px)}50%{transform:translateX(-1280px)}55%{transform:translateX(-1920px)}75%{transform:translateX(-1920px)}80%{transform:translateX(-2560px)}100%{transform:translateX(-2560px)}}.inner:hover{animation-play-state:paused;cursor:pointer}.innerwrapper{float:left;width:640px}.banner img{width:100%;height:300px}.AdvertisingLogo{position:absolute;right:0px;background:#000000;color:white;bottom:0px}#father{position:fixed;top:0;z-index:2147483647!important;width:100%;height:100%;background-color:rgba(0,0,0,0.7);display:flex;justify-content:center;align-items:center}#son{width:50%;height:50%;background-color:green;border-radius:1rem}#son>div{background-size:cover;background-attachment:fixed;background-repeat:no-repeat}.alertbox{width:80%;height:20%;background:rgba(255,255,255,0.95);border-radius:1rem;box-shadow:3px 1px 72px#888888;border:1px solid#007aff}.toptext{width:100%;height:70%;border-bottom:1px solid#007aff;display:flex;justify-content:center;align-items:center}.buottnbt{width:100%;height:30%;border-radius:2rem}.toptext h3{text-align:center}.let{width:49.5%;height:100%;float:left;border-radius:1rem;text-align:center;font-weight:600;display:flex;justify-content:center;align-items:center;color:#007aff}.let:active{background:#4a9bfa;background-color:rgba(0,0,0,0.2)}.rets{border-left:1px solid;border-top-left-radius:0em;border-top-right-radius:0em;border-bottom-right-radius:1em;border-bottom-left-radius:0em}#father{position:fixed;top:0;width:100%;height:100%;background-color:rgba(0,0,0,0.7);display:flex;justify-content:center;align-items:center;z-index:2147483647!important}#son{width:80%;height:90%;background-color:green;border-radius:1rem}#son>div{background-size:cover;background-attachment:fixed;background-repeat:no-repeat}.Mixlocs{position:absolute;right:2.5rem;background-color:rgba(0,0,0,0.2);line-break:normal;top:2rem;letter-spacing:0.5rem;color:#ffffff;padding:0.5rem;border-radius:1rem}.box{position:fixed;top:0;width:100%;height:100vh;margin:0 auto;background-repeat:no-repeat;background-size:cover;overflow:auto;z-index:2147483647!important}._container{overflow:hidden;text-align:center}._container li{width:100%;font-size:18px}._container li:first-child{margin-top:0;transition:margin-top 2s}.bouttBox{width:100%;background-color:#007AFF;height:10rem}.bouttBox ul{width:100%;height:100%}.bouttBox ul>li{width:100%;height:100%}.bouttBox ul>li img{width:100%height:100%}.contter{width:100%;height:100%;display:-webkit-flex;overflow:hidden}.contter>a{width:100%;height:100%}.contter>a>img{width:100%;height:85%;height:auto;max-width:100%;max-height:85%;animation:animated-border 1s infinite;font-family:Arial;font-weight:bold;color:#8f8f94;animation:fade-in;animation-duration:2s;-webkit-animation:fade-in 1.5s}`;
	const style = document.createElement('style');
	style.type = 'text/css';
	style.id = 'setstyle';
	style.innerHTML = Frames;
	document.querySelectorAll('head')[0].appendChild(style);

	interface confirmCentre {
		title: string | undefined;
		confirm: string | '确定';
		cance: string | '取消';
		src: string | 'https:www.baidu.com';
	}

	class CommercialTemplate {
		constructor(sw = false) {
			setTimeout(() => {
				this.publicJavaScript(sw);
			}, 500);
		}

		publicJavaScript(autoclos: boolean) {
			let num: number = 5,
				getDom: any | null,
				Mixlocs: any | undefined;

			// num = 5; // 默认为5秒跳出广告
			Mixlocs = document.getElementsByClassName('Mixlocs')[0];
			if (!Mixlocs) return false;
			getDom = Mixlocs.children[0];
			getDom.innerText = num;
			const interval = setInterval(function () {
				num--;
				getDom.innerText = num;
				if (num == 0) {
					var tg = getDom.parentNode;

					tg && (tg.innerHTML = '跳过');
					if (autoclos) {
						if (Mixlocs.parentNode.id === 'father') {
							Mixlocs.parentNode.remove();
							return false;
						}
						Mixlocs.parentNode.parentNode.remove();
					}
					if (tg.innerHTML === '跳过') {
						tg.onclick = function () {
							this.parentNode.remove();
							return false;
						};
					}
					clearInterval(interval);
				}
			}, 1000);
		}

		/**
		 * ${CustomEvent('templateMobile','')}
		 * ${CustomEvent('common','backgImage',img)}
		 * @param src 全屏广告
		 */
		fullScreen(img: string, src: string): string {
			return `<a href="${src}"><div class="box" style="${CustomEvent('common', 'backgImage', img)};"> ${CustomEvent('templateMobile', 'wait')}
        ${CustomEvent('templateMobile', 'signboard')}
        </div></a>`;
		}

		/**
		 *
		 * @param src 全屏中间位置位置
		 */
		middlePosition(img: string, src: string): string {
			return `<a href="${src}">	<div id="father">
            ${CustomEvent('templateMobile', 'wait')}
            <div id="son">
                <div style="${CustomEvent('common', 'w_h100')} ${CustomEvent('common', 'backgImage', img)};border-radius: 1rem;"></div>
                ${CustomEvent('templateMobile', 'signboard')}
            </div>
        </div></a>`;
		}

		/**
		 * 弹出框
		 * @param obj object
		 *
		 * title 显示的广告标题
		 * confirm 确定按钮
		 * cance 取消按钮
		 * src 广告路径
		 */

		confirmCentre(title: any, src: string, confirm: string, cance: string, yes: any, Noclos: any): string {
			setTimeout(() => {
				var mm: any = document.getElementsByClassName('buottnbt')[0].children;
				mm[0].onclick = function () {
					if (yes) {
						eval(`(${yes})()`);
					} else {
						window.location.href = src;
					}
					// window.location.href = src;
				};
				mm[1].onclick = function () {
					if (Noclos) {
						
						eval(`(${Noclos})()`);
					}
					document.getElementById('father') && document.getElementById('father').remove();
				};
			}, 500);

			const hh3 = `<h3>${title.length >= 75 ? title.substring(0, 60) : title}</h3>`;
			const img = `<img src="${title}" style='border-radius: 1rem 1rem 0 0;${CustomEvent('common', 'w_h100')}'>`;
			return `<div id="father">
            ${CustomEvent('templateMobile', 'wait')}
            <div class="alertbox">
                <div class="toptext">
                <a href="${src}" style='${CustomEvent('common', 'w_h100')}'>
                ${title.startsWith('https://') ? img : title.startsWith('http://') ? img : hh3}</a>
                </div>
                <div class="buottnbt">
                    <div class="let">
                        <strong style='${CustomEvent('common', 'color')}'>${!confirm ? '确定' : confirm}</strong>
                    </div>
                    <div class="rets let">
                        <strong style='${CustomEvent('common', 'color')}'>${!cance ? '取消' : cance}</strong>
                    </div>
                </div>
            </div>
            ${CustomEvent('templateMobile', 'signboard')}
        </div>`;
		}

		/**
		 * 底部多张图片
		 * @param img 广告图片
		 * @param src Array 广告路径
		 */
		downtitleImges(title: string, src: string, arrimg: any) {
			let tp = '', ImgtPath;
			
			
			let data = arrimg;
			if (arrimg instanceof Array) {
				ImgtPath = arrimg;
			} else if (typeof arrimg === 'string') {

				ImgtPath = arrimg.split(',');
			}

			// if (ImgtPath.length == 1) {
			// 	console.log(arrimg)
			// 	tp = `<div>
			// 	<a href="${arrimg[].href}" style="float:left;width:100%;height:100%;background-image: url(${item.img}); ackground-attachment: fixed; background-repeat: no-repeat;background-size: cover;"></a>
			// 	</div>`;
			// } else 
			// alert(data.length);
			
			if (data.length > 1) {
				data.forEach(item => {
					
				// 	tp += `<div>
                //     <img alt="穿职业装扮的尤里酱，让人眼前一亮，更有女人味了" class="lazy" data-original="http://upcdn.sdkv.top/250x250/aHR0cHM6Ly95LnZpcDk5Lnh5ei93cC1jb250ZW50L3VwbG9hZHMvc2hpcGluLzAwMDBfMDBfMDAvMWhzZzRoYXNyZHkubXA0LjBfMC5wMC5qcGc="
                //      src="${item}"style="display: inline;">
				// </div>`;
				
				tp += `<div>
				<a href="${item.href}" style="float:left;width:100%;height:100%;background-image: url(${item.img}); ackground-attachment: fixed; background-repeat: no-repeat;background-size: cover;"></a>
				</div>`;
				

				});
			}
			return `<div class="imgAdvertisementForm publictemplatestyle overleaf">
            <a href='${src}'><strong>${title}</strong></a>
            <div class="shoumeges ">
               ${tp}
            </div>
            ${CustomEvent('templateMobile', 'signboard')}
        </div>`;
		}

		/**
		 * 左边图片右边文字
		 * @param img 广告图片
		 * @param src 广告路径
		 * @param title 广告标题
		 */

		downmaster(img: string, src: string, title: string): string {
			return `<div class="zuoyoutuwen publictemplatestyle overleaf">
            <div class="let">
                <img src="${img}">
            </div>
            <div class="relt let">
                <strong><a href="${src}">${title}</a></strong>
            </div>
            ${CustomEvent('templateMobile', 'signboard')}
        </div>`;
		}

		/**
		 *底部新闻 右边 描述 左新闻 可向上循环移动
		 * @param lettitle string length in min 3
		 * @param newLst Array object {src:'',txt}
		 * @param time 间隔时间 默认为3000
		 */
		dowjournalism(lettitle: string, newLst: Array<object>, time: number = 3000): string {
			return General('newspapers', lettitle, JSON.parse(newLst),time);
		}

		/**
		 * 图片文字描述向上滚动
		 * @param obj  ArrAy object {src：‘点击后的链接’，txt：‘显示的文字’,img:'显示的图片'}
		 */

		shufflingthe(obj: Array<object>, time: number): string {
			return General('horizontalRotations', JSON.parse(obj), time);
		}
	}

	function FormalTemplate(of: boolean = false, type: string, ...prpy: any): any {
		let exist = null;
		CustomEvent('ServerDataSend', ...prpy);
		return exist || (exist = new CommercialTemplate(of)[type](...prpy));
	}
	let wd: any = window;

	wd['FormalTemplate'] = FormalTemplate;
})();

// PC模板
(() => {

	class terryscomputertips {

        /**
		 *底部新闻 右边 描述 左新闻 可向上循环移动
		 * @param lettitle string length in min 3
		 * @param newLst Array object {src:'',txt}
		 * @param time 间隔时间 默认为3000
		 */
		dowjournalism(lettitle: string, newLst: Array<object>, time: number = 3000): string {
			return General('newspapers', lettitle, JSON.parse(newLst), time, 10);
		}


        /**
		 * 图片文字描述向上滚动
		 * @param obj  ArrAy object {src：‘点击后的链接’，txt：‘显示的文字’,img:'显示的图片'}
		 */

		shufflingthe(obj: Array<object>, time: number): string {
			return General('horizontalRotations', JSON.parse(obj), time);
		}

        /**
         * 母版 有上下左右中模板，跟sq模板一样，参数一样
         * @param appleplet 
         */
		masterMask(appleplet: any) {
			if (appleplet.length > 0) {
				for (let g in appleplet) {
					this.pcm({
						site: appleplet[g].tp,
						a: appleplet[g].url,
						img: appleplet[g].img,
						id: appleplet[g].id,
						className: appleplet[g].className,
						sqcont: appleplet[g].sqcont
					});
				}
			}
		}

		pcm(order): void {
			this.tp = FindDom('setElement', 'div');
			let { site, id = '', className = '', sqcont = [] } = order;

			let { link, img } = main().AtwillImg(sqcont);
			main().colos();
			const include = 'position: fixed; z-index: 2147483647 !important;';
			const MTplaceLits = {
				top: `z-index: 2147483647 !important;width:100%;position: fixed;top: 0px`,
				bottom: `${include}width: 100%;bottom: 0;`,
				letft: `${include}width: 20%;bottom: 0;left: 0;top: 10%;`,
				right: `${include}width: 20%;bottom: 0;right: 0;top: 10%;`,
				conter: `${include} position: fixed; top: 0; bottom: 0; left: 0;  margin: auto; height: 50vh; width: 100%;`
			};

			const { Status, type } = linkType.isImageType(img);

			const video = `<video muted="" data-autoplay="" style="width: 100%;" loop="loop" autoplay="autoplay" src="${img}"  data-object-fit="">抱歉，您的浏览器不支持内嵌视频</video>`;

			const shouImg = `<img style='width: 100%; height: 9.4rem;z-index:2147483647' src="${img}" alt="">`;

			const colosstyle = `style="position: absolute;right: 0;z-index:2147483647;" class="initial_advertising_enable"`;

			const MTtemplate = {
				top: `<div class="up animated" style = 'height: 9.4rem;'><a style='z-index:2147483647' href="${link}">
                            ${Status == true && type !== false ? shouImg : video}
                            </a></div>`,
				bottom: `<div class="up animated" style = 'height: 9.4rem;opacity: 0.5;'> <i ${colosstyle}>${CustomEvent('templateMobile', 'shut_off')}</i><a href="${link}">
                ${Status == true && type !== false ? shouImg : video}
                            </a></div>`,
				conter: ` <i ${colosstyle} >${CustomEvent('templateMobile', 'shut_off')}</i>
                    <a  href="${link}">
                    ${
					Status == true && type !== false
						? `<img class="main_img img-hover" src="${img}" style="background-color: rgba(0, 0, 0,0.4); width: 100%; height: 50vh;object-fit: none;">`
						: video
					}
                    </a>`
			};

			switch (site) {
				case 'letft':
					FindDom('getBody').insertAdjacentHTML('afterBegin', `<div id = '${id}' class = '${className}' style = '${MTplaceLits.letft}'>${MTtemplate.conter}</div>`);
					return false;
				case 'right':
					FindDom('getBody').insertAdjacentHTML('afterBegin', `<div id = '${id}' class = '${className}' style = '${MTplaceLits.right}'>${MTtemplate.conter}</div>`);
					return false;
				default:
					// 以上匹配失败
					this.tp.id = id;
					this.tp.className = className;
					this.tp.style = MTplaceLits[site];
					this.tp.innerHTML = MTtemplate[site];

					console.log(this.tp)

					site === 'bottom' ? FindDom('getBody').insertBefore(this.tp, this.end) : FindDom('getBody').insertBefore(this.tp, this.start);
					return false;
			}
		}

		setBottomColor(src: string, img: string): void {
			if (!src || !img) return false;

			const colosstyle = `style="position: absolute;right: 0; z-index:2147483647;" class="initial_advertising_enable"`;
			return `<div class="conebox">
					
            <a href='${src}'>
            <div class="PICHND_PROTO_Produce_Picture" style="width:100%;height:60%;font-size: 22px;overflow: hidden;background: no-repeat center top / 100% 100%;position: fixed;bottom: 0;  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0)),url(${img});z-index:2147463647;">
            <i ${colosstyle} >${CustomEvent('templateMobile', 'shut_off')}</i>
            </div>
            </a>
    </div>`
		}
	}

	function pcend(...data: any) {
		let [funName, ...todata] = data;

		let computer = null;
		CustomEvent('ServerDataSend', ...data);
		console.log(...todata)
		return computer || (computer = new terryscomputertips()[funName](...todata));
	}

	window['pcComputer'] = pcend;
})();


